$(document).ready(function()
{
	//获取元素。
	var form=$('#Form_Close');
	var button=$('#Submit_Close');
	
	var orderNumber=$('#OrderNumber');
	var status_description=$('#Status_Description');
	
	var ac=$('#AlertContainer');
	var ace_status_description=$('#AlertContainer_Error_Status_Description');
	
	//事件绑定-描述
	status_description.keyup(function()
    {
        if(status_description.val()=='')
        {
            ace_status_description.fadeIn();
            ace_status_description.html('请填写关闭交易的原因');
            status_description.focus();
        }
        else{
            ace_status_description.fadeOut();
        }
    });	
	
	form.submit(function()
	{
		if(status_description.val()=='')
		{
			ace_status_description.html('请填写关闭交易的原因');
			ace_status_description.fadeIn();
			status_description.focus();					
			return false;
		}
		
		button.attr('disabled',true);
		ac.html('正在处理中，请稍候..');
		ac.css('color','black');		
		ac.show();

		setTimeout(function()
		{
			$.post(form.action,{'Status_Description':status_description.val(),'OrderNumber':orderNumber.val()},function($data)
			{
				switch($data)
				{					
					case 'Success':
						window.location='/exec.php?action=mc_transaction_seller_ordersheet_info&ordernumber'+orderNumber.val();					
					break;
					
					default:
						document.write($data);				
				}
			});							
		},1000);
		
		return false
	});		
});